CHDK Tools
This page describes some tools and utilities used for the CHDK development... Source code tools * These tools are part of the CHDK source, they are available from the CHDK SVN repository. rawconvert.c * Resides here: /tools * Forum links: http://chdk.setepontos.com/index.php/topic,2509.msg42402.html#msg42402, http://chdk.setepontos.com/index.php/topic,5207.msg50599.html#msg50599 * Authors: reyalP, cppasm This tool is intended to help porters verify their raw buffers and active area settings, by making 1:1 conversions of CHDK raw to easily viewable formats. It isn't built by default since it isn't normally needed. It can also be used to convert 10 to 12 bit or vice versa. Unlike dcraw, it does absolutely no interpolation, cropping, beautifying, folding, spindling or mutilating. Usage: : rawconvert - -w= -h= -noshift -pgm where is XtoY with X and Y being the source and destination BPP (Bits Per Pixel) by default :converting to lower BPP discards the lower bits of the input value. :converting to higher BPP shifts the input so the a max value input pixel will be a max value output pixel :without -pgm, output is in pure raw format: a sequence of pixels of the specified size. 8 and 16 bit output are suitable for use with "open as raw" in Photoshop or irfanview, gimps "raw image data", or feeding to imagemagick. if -noshift is specified :converting to a lower BPP discards the upper bits :converting to a higher BPP leaves the values unchanged if -pgm is specified :converting into PGM (portable graymap) file format :8 and 16 bits per pixel are supported, but 16 bit is supported by limited subset of viewers so it's better to use 8 bit PGM :PGM output is enabled with -pgm option, and you must specify .PGM extension to output file. :Sample: rawconvert.exe -10to8 -pgm -w=2672 -h=1968 CRW_0005.RAW IMG_0005.PGM :PGM input is not supported. NOTE: :- Host is assumed to be little endian! :- This is a debugging tool not an imaging tool. yuvconvert.c * Resides here: /tools * Forum links: http://chdk.setepontos.com/index.php/topic,5415.0.html Tool to convert UYVYYY live view data to easier to debug formats. Usage: : yuvconvert -w= -h= -split -rgb -skipy infile: dump of live viewport data, assumed UYVYYY with 8 bit elements. outbasename: base name to use for various output files -w=,-h=: :real width and height of input. Width is by counting Y values. -rgb: :Output packed 24 bit RGB outbasename-.RGB -skipy: :skip 50% of Y values in each row when making RGB to give correct aspect ratio on older cameras -split: :produces outbasename.Y outbasename.U and outbasename.V as 8 bit greyscale :.Y will be full resolution, .U and .V will be 1/4 width of Y NOTE: :- CHDK code frequently treats the viewport width as half the actual number of Y values. dancingbits.c * Resides here: /tools * Forum links: http://chdk.setepontos.com/index.php/topic,650.msg22572.html#msg22572, http://chdk.setepontos.com/index.php/topic,4095.msg38297.html#msg38297 This tool makes a CHDK firmware image bootable. There are 6 different methods available (cameras listings are not complete!): 1 // original flavor 2 // nacho cheese sx200is, ixus100_sd780, ixu95_sd1200, a1100, d10 3 // mesquite bbq ixus200_sd980, sx20 (dryos r39) 4 // cool ranch a3100 (dryos r43) 5 // cajun chicken s95 (dryos r45) 6 // spicy wasabi sx220 (dryos r47) dumpchk.c * Resides here: /tools * Forum link: http://chdk.setepontos.com/index.php/topic,2283.0.html Find the code normally found at the start of ROM. Default mode detects dryos or vxworks. If -fix is given, re-write the dump file after removing anything before the start sig If -vxworks or -dryos is given, just check that the corresponding sig is found at the start of the dump, and print a message/return status -quiet will suppress the message and only return status. If you have a tree full of dumps you want to check/fix, use find, e.g. find . -path ./*sub/* \! -path *.svn* -type d -exec dumpchk '{}/primary.bin' \; will check primary.bin in each of the platform/sub directories, skipping .svn, reporting missing or zero sized files. You can use -fix with the above command if you feel lucky. Note that -fix DOES NOT MAKE ANY BACKUP, and is NOT PARTICULARLY SAFE. Category:Development Category:CHDK internals